
<template>
  <div class="Inspection">
    <div class="Ins-l">
      <InfoCar :CarListInfo='CarListInfo' class="infocar"></InfoCar>
      <ReportCar :xamReportList="xamReportList" @xamReport="FoxMessage"></ReportCar>
    </div>
    <div class="Ins-r">
      <InfoTit title="检查报告"></InfoTit>
      <div class="pro-details">
        <div class="pro-col">
          <div class="pro-col-r">
            <span>姓名:</span>
            <span>{{personal.pa_name}}</span>
          </div>
          <div class="pro-col-r">
            <span>病例号:</span>
            <span>{{personal.case_number}}</span>
          </div>
          <div class="pro-col-r">
            <span>性别:</span>
            <span>{{personal.sex_name}}</span>
          </div>
          <div class="pro-col-r">
            <span>年龄:</span>
            <span>{{personal.pa_age1}}</span>
          </div>
        </div>
        <div class="pro-col">
          <div class="pro-col-r">
            <span>检查号:</span>
            <span>{{personal.pa_id}}</span>
          </div>
          <div class="pro-col-r">
            <span>科别:</span>
            <span>{{personal.in_dpname}}</span>
          </div>
          <div class="pro-col-r">
            <span>病区:</span>
            <span>{{personal.dp_name}}</span>
          </div>
          <div class="pro-col-r">
            <span>检查类别:</span>
            <span>{{checkItem.exam_type}}</span>
          </div>
        </div>
      </div>
      <div class="check-pro">
        <p>检查项目</p>
        <div class="pro-name">
          <span>检查项目:</span>
          <span>{{checkItem.apply_name}}</span>
        </div>
      </div>
      <!--<div class="check-pro">
        <p>表现</p>
        <div class="pro-name">
          <span>表现:</span>
          <span>{{checkItem.patient_status}}</span>
        </div>
      </div>-->
      <div class="check-pro">
        <p>报告所见</p>
        <div class="pro-name">
          <span>报告所见:</span>
          <span class="text">{{checkItem.findings}}</span>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
import ReportCar from '../common/ReportCar'
import InfoCar from '../common/InfoCar'
import InfoTit from '../common/InfoTit'
import axios from 'axios'
import urls from '../../common'
export default {
  name: 'Inspection',
  components: {
    ReportCar,
    InfoCar,
    InfoTit
  },
  data () {
    return {
      CarListInfo: {
        src: require('../../img/wardR/chest-icon.png'),
        InfoTit: this.$store.state.personinfo.belong_dpname,
        decide: true,
        bgImg: require('../../img/wardR/aid-bg.png'),
        boxS: '-.1rem -.1rem .3rem 0 #d5e9e6',
        InfoCon: ['x', '27', '床']
      },
      xamReportList: [],
      personal: {},
      checkItem: {}
    }
  },
  methods: {
    basicInfo (bed) {
      axios.get(urls.examReportBasic + '/' + bed)
        .then((res) => {
          if (res.data.code === '200') {
            this.personal = res.data.data
            this.examReportInfo(this.personal.pa_id, this.personal.in_time)
          }
        })
    },
    examReportInfo (id, intime) {
      const Qs = require('qs')
      axios.post(urls.examReportInfo, Qs.stringify({paId: id, inTime: intime}),
        {
          headers: {
            'Content-Type': 'application/x-www-form-urlencoded;charset=utf-8'
          }
        }
      ).then((res) => {
        if (res.data.code === '200') {
          this.xamReportList = res.data.data
          if (res.data.data.length === 0) {
          } else {
            this.labtestReportInfo(this.xamReportList[0].id)
          }
        }
      })
    },
    labtestReportInfo (Id) {
      const Qs = require('qs')
      axios.post(urls.examReportDetail, Qs.stringify({id: Id}),
        {
          headers: {
            'Content-Type': 'application/x-www-form-urlencoded;charset=utf-8'
          }
        }
      ).then((res) => {
        if (res.data.code === '200') {
          this.checkItem = res.data.data
        }
      })
    },
    FoxMessage (Id) {
      this.labtestReportInfo(Id)
    }
  },
  mounted () {
    this.basicInfo(this.$store.state.bedNo)
  }
}
</script>

<style style="stylus" scoped>
  .Inspection{
    display: flex;
    padding: 0 .3rem;
  }
  .Inspection .infocar{
    margin-bottom: .1rem;
  }
  .Inspection .Ins-r{
    flex: 1;
    height: 8.54rem;
    font-size: .24rem;
    margin-left:.3rem;
    background: #fff;
    padding: 0 .2rem;
    border-radius: 0.1rem;
    box-shadow: 0px 0.11rem 0.24rem 0px rgba(127, 135, 143, 0.1);
    overflow-y: scroll;
  }
  .Inspection .Ins-r::-webkit-scrollbar {
    display:none
  }
  .Inspection .Ins-r .pro-col{
    display: flex;
    /* justify-content: space-between; */
    margin-bottom: .43rem;
  }
  .Inspection .Ins-r .pro-col .pro-col-r{
    /* flex: 1; */
    width: 3.1rem;
    padding-right: 0.08rem;
  }
  .Inspection .Ins-r .pro-col .pro-col-r>span:first-child{
    display: inline-block;
    width: 1.1rem;
    color: #7e92ab;
  }
  .Inspection .Ins-r .pro-col .pro-col-r>span:last-child{
    color: #161d26;
  }

  .Inspection .Ins-r .check-pro>p{
    color: #161d26;
    margin-bottom: .27rem;
  }
  .Inspection .Ins-r .check-pro .pro-name{
    margin-bottom: .63rem;
  }
  .Inspection .Ins-r .check-pro .pro-name span:nth-child(1){
    display: inline-block;
    width: 1.5rem;
    color: #7e92ab;
  }
  .Inspection .Ins-r .check-pro .pro-name span:nth-child(2){
    width: 1.5rem;
    /* color: #7e92ab; */
  }
  .Inspection .Ins-r .check-pro .pro-name .text{
    word-wrap: break-word;
    letter-spacing: .02rem;
    line-height: .4rem;
  }
</style>
